package com.xingkeduo.pojo.utils;

import lombok.extern.slf4j.Slf4j;

import java.math.BigDecimal;

/**
 * @Description:
 * @Author:gaozifeng
 * @Date 2019/5/7 11:21
 **/
@Slf4j
public class BigDecimalUtils {

    /**
     * 四舍六入五去偶
     *
     * @param num:
     * @return : java.math.BigDecimal
     * @author : gaozifeng
     * @date : 2019/5/7 11:23
     */
    public static BigDecimal bankRound(String num) {
        BigDecimal bigDecimal =new BigDecimal(num).setScale(2,BigDecimal.ROUND_HALF_UP);
        return bigDecimal;
    }
}
